import request from '@/utils/request'


export function getRoles() {
    return request({
        url: 'roles',
        method: 'get'
    })
}
export function getRolesById(url) {
    return request({
        url: url,
        method: 'get'
    })
}
export function deleteRoles(url) {
    return request({
        url: url,
        method: 'delete'
    })
}
export function getRightsTree() {
    return request({
        url: 'rights/tree',
        method: 'get'
    })
}
export function addRoles(url, data) {
    return request({
        url: url,
        method: 'post',
        data: data
    })
}
export function addOrPutRole(url, type, data) {
    return request({
        url: url,
        method: type,
        data: data
    })
}
export function deleteRolesById(url) {
    return request({
        url: url,
        method: 'delete'
    })
}